package com.yc.springcloud.service;

import com.yc.springcloud.entity.Member;
import com.yc.springcloud.service.impl.MemberFeignFallbackService;
import com.yc.springcloud.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author DELL
 * @Date 2024/11/12 21:12
 * @Version 1.0
 */
@Component
//openFeignService远程调用
@FeignClient(value = "member-service-nacos-provider",
		fallback = MemberFeignFallbackService.class)
public interface MemberOpenFeignService {

	/**
	 * @FeignClient(value = "member-service-nacos-provider") + @GetMapping(value = "/member/get/{id}")
	 * 远程调用的 member-service-nacos-provider/member/get/{id}
	 * @param id
	 * @return
	 */
	@GetMapping(value = "/member/get/{id}")
	public Result<Member> getMemberById(@PathVariable("id") long id);
}
